import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";

const { createConfirm } = useMessage();

enum Api {
  list = '/esidcard/card/getBindParents',
  unbind = '/esidcard/card/unbind',
  save='/esidcard/card/add'
  
}


/**
 * 列表接口
 * @param params
 */
export const list = (params) =>
  defHttp.get({url: Api.list, params});


/**
 * 保存或者更新
 * @param params
 */
export const save = (params, isUpdate) => {
  let url = isUpdate ? Api.save : Api.save;
  return defHttp.post({url: url, params});
}

/**
 * 解绑家长
 */
export const unbind = (params,handleSuccess) => {
  defHttp.get({url: Api.unbind, params}, {joinParamsToUrl: true}).then(() => {
    handleSuccess();
  });
}


